﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OneToMore.aspx.cs" Inherits="iSun.WebApp.Extend.OneToMore" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <!--CSS file (default YUI Sam Skin) -->
    <script src="../Scripts/EasyUI/js/jquery-1.6.min.js" type="text/javascript"></script>
    <link href="../Scripts/EasyUI/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/EasyUI/js/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../Scripts/fullscreen.js" type="text/javascript"></script>
    <script src="../Scripts/Jquery.form.js" type="text/javascript"></script>
    <link href="../Styles/show/css/show-bar.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/base.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function addTabs(title, pageurl, icon) {
            if (!$('#tabs').tabs('exists', title)) {
                $('#tabs').tabs('add', {
                    title: title,
                    content: createFrame(pageurl),
                    iconCls: icon,
                    //closable: true,
                    width: $('#mainPanle').width() - 10,
                    height: $('#mainPanle').height() - 26
                });
            } else {
                $('#tabs').tabs('select', title);
            }
        }

        function createFrame(url) {
            var s = '<iframe scrolling="auto" frameborder="0"  src="' + url + '" style="width:100%;height:100%;"></iframe>';
            return s;
        }

        var win = {
            a: 0,
            b: 0,
            c: 0,
            d: 0,
            e: 0,
            f: 0,
            h: 0
        }
         function show() {
            var btn = parent.document.getElementById("yui-gen7-button");
            $(btn).show();
        }

        function hide() {
            var btn = parent.document.getElementById("yui-gen7-button");
            $(btn).hide();
            //debugger
            var t = $.browser;
            /**/
            var ctrl = event.srcElement;
            //if ($.browser.msie) {
                switch (ctrl.innerHTML) {
                    case "工作经历":
                        if (win.a == 0) {
                            window.frames[1].location.reload();
                        }
                        win.a = 1;
                        break;
                    case "教育经历":
                        if (win.b == 0) {
                            window.frames[2].location.reload();
                        }
                        win.b = 1;
                        break;
                    case "技能信息":
                        if (win.c == 0) {
                            window.frames[3].location.reload();
                        }
                        win.c = 1;
                        break;
                    case "工作合同":
                        if (win.d == 0) {
                            window.frames[4].location.reload();
                        }
                        win.d = 1;
                        break;
                    case "培训经历":
                        if (win.e == 0) {
                            window.frames[5].location.reload();
                        }
                        win.e = 1;
                        break;
                    case "项目经历":
                        if (win.f == 0) {
                            window.frames[6].location.reload();
                        }
                        win.f = 1;
                        break;
                }
            //}
           /**/

        }


        $(document).ready(function () {
            var condition = encodeURI("EmployeeID='<% =MasterEntityID %>'");
            var functionID = getPar(parent.location.href, "functionid");
                addTabs("<span onclick='show();'>基本信息</span>", "AutoLoadForm.aspx?entity=hrEmployee&id=<% =MasterEntityID %>");
                addTabs("<span onclick='hide();'>工作经历</span>", "YUIDataTableList.aspx?f=a&isShonwBtn=N&functionid=" + functionID + "&entity=hrEmployeeExperiences&id=<% =MasterEntityID %>&condition=" + condition);
                addTabs("<span onclick='hide();'>教育经历</span>", "YUIDataTableList.aspx?f=b&isShonwBtn=N&functionid=" + functionID + "&entity=hrEmployeeEducations&id=<% =MasterEntityID %>&condition=" + condition);
                addTabs("<span onclick='hide();'>技能信息</span>", "YUIDataTableList.aspx?f=c&isShonwBtn=N&functionid=" + functionID + "&entity=hrEmployeeSkills&id=<% =MasterEntityID %>&condition=" + condition);
                addTabs("<span onclick='hide();'>工作合同</span>", "YUIDataTableList.aspx?f=d&isShonwBtn=N&functionid=" + functionID + "&entity=hrEmployeeContracts&id=<% =MasterEntityID %>&condition=" + condition);
                addTabs("<span onclick='hide();'>培训经历</span>", "YUIDataTableList.aspx?f=e&isShonwBtn=N&functionid=" + functionID + "&entity=hrEmployeeTrainings&id=<% =MasterEntityID %>&condition=" + condition);
                //addTabs("任职信息", "YUIDataTableList.aspx?isShonwBtn=N&entity=hrEmployeePositions&id=<% =MasterEntityID %>&condition="+condition);

                addTabs("<span onclick='hide();'>项目经历</span>", "YUIDataTableList.aspx?f=f&isShonwBtn=N&functionid=" + functionID + "&entity=hrEmployeeProjects&id=<% =MasterEntityID %>&condition=" + condition);

                $('#tabs').tabs('select', "<span onclick='show();'>基本信息</span>");
          
        });
    </script>
    <!--begin custom header content for this example-->
    <style type="text/css">
    .yui-skin-sam table {
	  width: 100%; 
    }
    
    #button-example-form fieldset, 
    #button-example-form fieldset div {
        border: 2px groove #ccc;
        margin: .5em;
        padding: .5em;
    }
</style>
   

</head>
<body class="easyui-layout">
      <div id="mainPanle" region="center" style="background: #eee; overflow-y: hidden">
        <div id="tabs" class="easyui-tabs" fit="true" border="false">
        </div>
    </div>
</body>
<script>
    function Save() {
        //alert("");
        $("iframe")[0].contentWindow.Save();
    }
</script>
</html>
